package com.jwgf.smarowindingmachine_unity.ui;

import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;

import androidx.fragment.app.DialogFragment;

import com.jwgf.smarowindingmachine_unity.R;

import java.util.List;

public class GroupProductionDialog extends DialogFragment {

    public static String GROUP_PRODUCTION = "group_production";

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        Bundle bd = getArguments();
        List<String> productions = bd.getStringArrayList(GROUP_PRODUCTION);
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        String[] items = new String[productions.size()];
        for (int i = 0; i < items.length; ++i) {
            items[i] = getString(R.string.group) + (i + 1) + " : " + productions.get(i) + getString(R.string.print_unit_kg);
        }
        builder.setTitle(getString(R.string.group) + getString(R.string.ms_throughput));
        builder.setItems(items, null);
        return builder.create();
    }
}
